package com.oa.pm.dto;

import com.baomidou.mybatisplus.plugins.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class CommonDTO<T> {
    @ApiModelProperty("页码")
    private Integer pageNum;

    @ApiModelProperty("行数")
    private Integer pageSize;

//    @ApiModelProperty(value = "页对象", hidden = true)
//    private Page<T> page;

    public Page<T> getPage() {
        if(this.getPageNum() != null && this.getPageSize() != null){
            return new Page<T>(this.getPageNum(), this.getPageSize());
        }
        return null;
    }
}
